# Maintainer(Arch): Felix Yan <felixonmars@archlinux.org>
# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Maintainer: Sagar Acharya <sagar@hyperbola.info>

pkgname=python-beautifulsoup4
pkgver=4.9.3
pkgrel=1
pkgdesc="A Python HTML/XML parser designed for quick turnaround projects like screen-scraping"
arch=('any')
url="https://www.crummy.com/software/BeautifulSoup/index.html"
license=('Python')
depends=('python-soupsieve')
optdepends=('python-chardet: to autodetect character encodings'
            'python-lxml: alternative HTML parser'
            'python-html5lib: alternative HTML parser')
makedepends=('python-setuptools')
checkdepends=('python-pytest')
source=("https://www.crummy.com/software/BeautifulSoup/bs4/download/4.9/beautifulsoup4-${pkgver}.tar.gz")
sha512sums=('e3cb6258bd7c51f12128fa8ee5948fb3566163ae233fac2dda21bab7772ab8dbb384d920b0ea138ef9921307b48f89cee3a9bf6111dfc8903d917ee7af365f34')

build() {
  cd beautifulsoup4-$pkgver
  python setup.py build
}

#check() {
#  cd beautifulsoup4-$pkgver/build
#  pytest
#}

package() {
  cd beautifulsoup4-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1 --skip-build
  
  install -Dm644 COPYING.txt "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}
